package com.hqyj.demo.controller;

import com.hqyj.shop.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.*;

/**
 * 项目:shop-admin-240701
 * 描述:
 * 时间:2024/9/29 10:57
 * 作者:admin
 * 版本:1.0
 **/
@RestController
@RequestMapping("/demo")
@PropertySource(value = "classpath:config/myConfig.properties",encoding = "utf-8")
public class DemoController {



    @Value("${my.age}")
    private Integer a;

    //端口号
    @Value("${server.port}")
    private int port;

    @GetMapping("/test01")
    public String test01(){
        System.out.println("你好1111");
        return "3333姓名:年龄:"+a+" 端口号:"+port;
    }

    @PostMapping("/test02")
    public String test02(@RequestBody  UserInfo userInfo){
        System.out.println("你好1111");
        return "3333姓名:年龄:"+a+" 端口号:"+port;
    }
}
